#! /bin/bash

# for the plot_data() function.
. /home/bmort/Thesis/spectCleanGui/scripts/plotting/plot_data.sh

# Titles
# ------------------------------------------------------------------------------
t1="Time Series"
t2="Dirty Spectrum"
t3="Spectral Window"
t4="Clean Spectrum"

# Axis labels
# ------------------------------------------------------------------------------
xL1="Time [Julian Days]"
xL2="Frequency [days^{-1}]"
xL3="Periodicity [days]"
yL1="Derived Speed [c]"
yL2="FT(z_{+} + z_{-})"
yL3="Amplitude"

# Data paths
# ------------------------------------------------------------------------------
dir=`pwd`/l1000-g01
pdir=`pwd`/plots-l1000-g01
time=speeds.dat
dirty=${dir}/dirty_0.spect
window=${dir}/window_0.spect
clean=${dir}/clean_residual_0.spect


plot_data "t" $time ${pdir}/time       "$t1" "$xL1" "$yL1" 2443600 2450500

plot_data "s" $dirty ${pdir}/dirty1   "$t2" "$xL2" "$yL2" 0.0 0.1
plot_data "a" $dirty ${pdir}/dirtyA1  "$t2" "$xL2" "$yL2" 0.0 5.0
plot_data "a" $dirty ${pdir}/dirtyA2  "$t2" "$xL2" "$yL2" 0.0 1.0
plot_data "a" $dirty ${pdir}/dirtyA3  "$t2" "$xL2" "$yL2" 0.0 0.5
plot_data "p" $dirty ${pdir}/dirtyP1  "$t2" "$xL2" "$yL2" 3 20
plot_data "p" $dirty ${pdir}/dirtyP2  "$t2" "$xL2" "$yL2" 10 15
plot_data "p" $dirty ${pdir}/dirtyP3  "$t2" "$xL2" "$yL2" 12 14
plot_data "p" $dirty ${pdir}/dirtyP4  "$t2" "$xL2" "$yL2" 13 13.2

plot_data "a" $window ${pdir}/windowAmp1 "$t3" "$xL2" "$yL3" 0.0 10.0
plot_data "a" $window ${pdir}/windowAmp2 "$t3" "$xL2" "$yL3" 0.0 2.0

plot_data "s" $clean ${pdir}/clean1   "$t4" "$xL2" "$yL2" 0.0  0.1
plot_data "s" $clean ${pdir}/clean2   "$t4" "$xL2" "$yL2" 0.05 0.1
plot_data "a" $clean ${pdir}/cleanA1  "$t4" "$xL2" "$yL2" 0.0  2.0
plot_data "a" $clean ${pdir}/cleanA2  "$t4" "$xL2" "$yL2" 0.0  1.0
plot_data "p" $clean ${pdir}/cleanP1  "$t4" "$xL3" "$yL2" 0.5 200
plot_data "p" $clean ${pdir}/cleanP2  "$t4" "$xL3" "$yL2" 2 30
plot_data "p" $clean ${pdir}/cleanP3  "$t4" "$xL3" "$yL2" 5 20
plot_data "p" $clean ${pdir}/cleanP4  "$t4" "$xL3" "$yL2" 10 15
plot_data "p" $clean ${pdir}/cleanP5  "$t4" "$xL3" "$yL2" 12 13.5
plot_data "p" $clean ${pdir}/cleanP6  "$t4" "$xL3" "$yL2" 12 14
plot_data "p" $clean ${pdir}/cleanP7  "$t4" "$xL3" "$yL2" 13 13.2


